package com.acertificate.sql;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.commons.io.IOUtils;

public class UniteSQL {

	public static final String IN_DIR = "C:/excellentarticle/";
	public static final String OUT_FILENAME = "C:/excellentarticle/000000000000.sql";

	/**
	 * @param args
	 * @throws IOException
	 * @throws FileNotFoundException
	 */
	public static void main(String[] args) throws FileNotFoundException, IOException {
		File dir = new File(IN_DIR);
		File[] fs = dir.listFiles();
		StringBuffer sb = new StringBuffer();
		for (File file : fs) {
			sb.append(IOUtils.toString(new FileInputStream(file)));
		}
		IOUtils.write(sb.toString(), new FileOutputStream(new File(OUT_FILENAME)));
	}

}
